package com.itheima.health.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.health.common.MessageConst;
import com.itheima.health.entity.Result;
import com.itheima.health.pojo.Menu;
import com.itheima.health.service.MenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Created by Wxk
 * @date: 2020/11/21 14:07
 * @description:
 * @version：1.0
 */
@RestController
@Slf4j
@RequestMapping("menu")
public class MenuController {
    @Reference
    private MenuService menuService;

    @RequestMapping("getMenuList")
    public Result getMenuList(String username){
        List<Menu> menu=menuService.findMenuListByUsername(username);
        return new Result(true, MessageConst.GET_MENU_SUCCESS,menu);

    }

}
